class People{
    name: string
    constructor( n: string ) {
        this.name = n
    }

    getName(): string{
        return this.name
    }

    setName( name: string ) {
        this.name = name
    }
}

let q = new People( 'xiaohui' )

q.getName()//xiaohui

q.setName( 'xiaomei' )

q.getName()//xiaomei
